package de.mhus.lib.core.lang;

import de.mhus.lib.core.MActivator;
import de.mhus.lib.core.logging.ConsoleFactory;
import de.mhus.lib.core.logging.Log;
import de.mhus.lib.core.logging.LogFactory;

public class StaticBase extends MObject {

//	private Log log;

	private Object owner;
	private Log log;

	public StaticBase() {
//		super((MActivator)null);
//		log = new ConsoleFactory().getLog(StaticBase.class); //TODO change this
	}

	public StaticBase(Object owner) {
		this.owner = owner;
	}

	@Override
	public synchronized Log log() {
		if (log == null) {
			Class<?> c = this.getClass();
			if (owner != null) {
				c = owner instanceof Class ? (Class<?>)owner : owner.getClass();
			}
			log = base(LogFactory.class).getLog(c);
		}
		return log;
	}

	@Override
	public <T> T base(Class<T> ifc) {
		return super.base(ifc);
	}
	
	@Override
	public Base base() {
		return super.base();
	}
	
}
